package com.list.zuoye;

import java.util.ArrayList;

/*
请定义教师（Teacher）类，属性包含姓名和专业名称。
将若干教师对象存入ArrayList集合中，并遍历集合打印教师信息，
格式如下：
姓名：果果老师, 专业：javase
姓名：张1老师, 专业：javaee
姓名：张2老师, 专业：php
姓名：张3老师, 专业：python
 */
public class TestTeacher02 {
    public static void main(String[] args) {
        ArrayList<Teacher> list = new ArrayList<>();
        Teacher t1 = new Teacher("果果老师","javase");
        Teacher t2 = new Teacher("张1老师","javase");
        Teacher t3 = new Teacher("张2老师","php");
        Teacher t4 = new Teacher("张3老师","pythone");
        list.add(t1);
        list.add(t2);
        list.add(t3);
        list.add(t4);
        for (int i = 0; i < list.size(); i++) {
            // list.get(i)
            Teacher teacher = list.get(i);
            System.out.println(teacher);
        }

    }
}
